The present invention relates to a nonvolatile semiconductor memory in which data can be rewritten in units of blocks (or sectors) of the memory cell array.
A flash EEPROM, for example, has a memory cell array (e.g., a 4-MB array or a 16-MB array). The data stored in the memory cell array can be rewritten (that is, data is erased or written), either at a time or in units of block (each block capable of storing 32 kilobits, 64 kilobits or 256 kilobits).
To protect the data stored in the blocks of the memory cell array, one protect circuit is provided for each block. As long as the protect circuit remains in protect mode, it prevents the rewriting of data in the memory cells constituting the block.
The flash EEPROM is set in test mode in order to determine whether or not the protect circuit has been reliably set in the protect mode. In the test mode, it is tried to erase or write data in the memory cells forming each block. If the data is erased or written in the block, the protect circuit is found not set in the protect mode. If the data is neither erased nor written, the protect circuit is proved to perform its function.
A long time is required to test each protect circuit, because two steps of operation must be performed. First, it is necessary to attempt to erase or write data in the block. Then it is necessary to read data from the block to see whether or not the protect circuit has been reliably set in the protect mode. It takes about 1.0 sec to erase the data in one block, and about 0.5 to 0.7 sec to write data in one block.
Thus, in a conventional nonvolatile semiconductor memory, it is first tried to erase or write data in each memory block and then data is read from the block, thereby determining whether or not the protect circuit provided for the block has been set in the protect mode. Any protect circuit that has prevented the rewriting of data in the associated block is regarded as a good one. However, a long time is required to test each protect circuit, because it takes much time to erase or write data in each block. This inevitably increases the manufacturing cost of the nonvolatile semiconductor memory.